<?php /* SVN: $Id: zone.ctp 52640 2011-05-05 06:16:29Z lakshmi_150act10 $ */?>
<div class="deal-our-inner-block clearfix">
   <div class="main-shad">&nbsp;</div>
      <div class="side1">
      <div class="block1 clearfix">
          <div class="side1-tl">
            <div class="side1-tr">
              <div class="side1-tm"> </div>
            </div>
          </div>
          <div class="side1-cl">
            <div class="side1-cr">
              <div class="block1-inner">
              <h2 class="title"><?php echo $titlepage;?></h2>      

         	<ol class="recent-list clearfix">
    		<?php if(!empty($adilities->offers)): ?>
    		  <?php foreach($adilities->offers as $i =>$deal): ?>
                <li>
                  <div class="deals-content clearfix">
                    <div class="side1-tl">
                      <div class="side1-tr">
                        <div class="side1-tm"> </div>
                      </div>
                    </div>
                    <div class="side1-cl">
                      <div class="side1-cr">
                        <div class="block1-inner clearfix">
                          <div class="deal-img">
                            <?php echo $html->link($html->image($deal->creative->illustrations[0]->url,array('width'=>285,'height'=>199,'class'=>'thumb')),array('controller' => 'deals', 'action' => 'adility', $deal->id),array('title'=>$deal->title,'escape' =>false))?>
                           </div>
                          <div class="deal-info">
                            <h3><?php echo $html->link($deal->title,array('controller' => 'deals', 'action' => 'adility', $deal->id),array('title'=>$deal->title))?></h3>
                          </div>
                          <div class="bought-content">
                            <div class="bought-details">
                             	<dl class="price-count clearfix">
    				            	<dt><?php echo __l('Price'); ?></dt>
                                    <dd><?php echo $deal->price->formatted_amount; ?></dd>
    					       </dl>
                                <dl class="price-sount-list">
                                  	<dt><?php echo __l('Value'); ?></dt>
    				            	<dd><?php echo $deal->value->formatted_amount; ?></dd>
                                </dl>
                                <dl class="price-sount-list">
                                 	<dt><?php echo __l('Discount');?></dt>
        					        <dd><?php echo $html->cInt(($deal->value->amount-$deal->price->amount)*100/$deal->value->amount) . "%"; ?></dd>
                                </dl>
                                <dl class="price-sount-list">
                                     <dt><?php echo __l('Savings'); ?></dt>
        					         <dd><?php echo $html->siteCurrencyFormat($html->cCurrency(($deal->value->amount - $deal->price->amount) / 100)); ?></dd>
                                </dl>
                            </div>
                          </div>
                          <div class="bg_ho">
                                <div class="js-widget-deal-end-countdown">&nbsp;</div>
                                <span class="js-time hide"><?php
                                    echo $end_time = intval(strtotime($deal->end_date.' GMT') - time());
                                ?></span>
                          </div>
                          <div class="deal_bottom">
                             <div class="bimg">
                                <?php echo $html->image('shopping_bag.png',array('width'=>50,'height'=>50))?>  
                              </div>
                              <div class="btext"> 
                                <p class="progress-desc"><?php echo $deal->quantity_in_stock?> quanlity in stock.</p>
                             </div>
                             <?php echo $html->link('',array('controller' => 'deals', 'action' => 'adility', $deal->id),array('class'=>'showdealbut'))?>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div class="side1-bl">
                      <div class="side1-br">
                        <div class="side1-bm"> </div>
                      </div>
                    </div>
                    
                  </div>
              	</li>
                
                <?php 
                    echo $this->element('advertiser-center',array('now'=>$i+1,'sl'=>3));
                ?>
                
    			  <?php endforeach; ?>
                  
                  
    			<?php else: ?>
    				<li>
                       <div class="side1-tl">
                          <div class="side1-tr">
                            <div class="side1-tm"> </div>
                          </div>
                        </div>
                        <div class="side1-cl">
                        <div class="side1-cr">
                        <div class="block1-inner clearfix">
                        <p class="notice"><?php echo __l('No Deals available');?></p>
                         </div>
                        </div>
                      </div>
                        <div class="side1-bl">
                          <div class="side1-br">
                            <div class="side1-bm"> </div>
                          </div>
                        </div>
                    </li>
    			<?php endif; ?>
    			</ol>
            	<div class="clearfix">
    			<?php
    			if (!empty($adilities)):
                    echo $paginglinks->navigation(array('controller' => 'deals', 'action' => 'zone', 'admin' => false),$total_items,$page);
    			endif;
    			?>
    		    </div>
      
            </div>
        </div>
        </div>
        <div class="side1-bl">
            <div class="side1-br">
              <div class="side1-bm"> </div>
            </div>
        </div>
        </div>
      </div>
      <?php echo $this->element('../deals/sidebar', array('deal' => $deal, 'count' => $count, 'get_current_city' => $get_current_city, 'cache' => array('time' => Configure::read('site.element_cache'))));?>
</div>
<div id="fb-root"></div>
	<script type="text/javascript">
	  window.fbAsyncInit = function() {
		FB.init({appId: '<?php echo Configure::read('facebook.app_id');?>', status: true, cookie: true,
				 xfbml: true});
	  };
	  (function() {
		var e = document.createElement('script'); e.async = true;
		e.src = document.location.protocol +
		  '//connect.facebook.net/en_US/all.js';
		document.getElementById('fb-root').appendChild(e);
	  }());
	</script>